<template>
    <div class="uploadWorks">
         <van-row type="flex" justify="space-between" class="head" >
             <van-col @click="tankuang">
                 <img src="http://qxkmdhmin.hn-bkt.clouddn.com/guanbi.png" alt="">
             </van-col>
             <van-col>
                 <h2 class="public">发布</h2>
             </van-col>
         </van-row>
         <!-- 作品图片 -->
        <van-uploader v-model="fileList" multiple :max-count="9"  :after-read="afterRead"/>
        <!-- 作品描述 -->
         <van-field
            v-model="message"
            autosize
            rows="4"
            type="textarea"
            placeholder="分享你的下厨心得，生活点滴"
            class="field"
        />
        <van-divider :style="{ borderColor: '#cccc'}"  class="line"/>     
            <img src="../assets/weibo.png" alt="" class="weiboImg">
            <span class="weibo">同步到微博</span>   
            <van-switch v-model="checked" size="26px" class=".share"/>
        <van-divider :style="{ borderColor: '#cccc'}"  class="line"/>
    </div>
</template>


<script>
export default {
    data(){
        return{
           fileList:[],
           message:'',
           checked:false
        }
    },
    methods:{
       afterRead(){
           if(this.fileList.length=9){         
           }
       },
       tankuang(){
           this.$dialog.confirm({
            message: '确定要放弃本次编辑？',
            })
            .then(() => {
                this.$router.push('/person');
            })
            .catch(() => {
                // on cancel
            });  
          }
        }
}
</script>

<style lang="scss" >
  .uploadWorks{
      padding:.8rem ;
      .head{
          margin-bottom: 1rem;
          .public{
              font-size: 20px;
              color: red;
          }
      }
      .field{
          margin-left:-.8rem;
      }
      .van-cell{
          font-size: 16px;  //设置输入field区域的字体大小
          caret-color: red;

      }
      .weiboImg{
          width: 25px;
          height: 25px;
          margin: -16px 10px 0 0;
      }
      .weibo{
          font-size: 18px;
      }
      //同步按钮的设置
      .share{
         margin-left:200px !important;
      }
      .van-switch{
        left: 48%
      }
      .van-switch--on{
          background-color: red;
      }
   
  }
</style>